<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::get('/','IndexController@index');

Route::get('/login','UserController@login');

Route::post('/loginCheck','UserController@check');

Route::get('/home/article/{article}','ArticleController@show');

Route::post('/answer/create','AnswerController@create');

Route::group(['middleware'=>'auth'],function (){

    Route::get('/logout','UserController@logout');

    Route::get('admin/index','UserController@index');

    Route::get('/welcome', function () {
        return view('welcome');
    });

    Route::resource('cate','CateController');

    Route::resource('article','ArticleController');

    Route::resource('tag','TagController');

    Route::post('article/upload','ArticleController@upload');

    Route::post('/checkStatus/{cate}','CateController@checkStatus');

    Route::post('/articleStatus/{article}','ArticleController@articleStatus');

//    Route::get('/articleImg/{article}','ArticleController@addImg');

    Route::post('/articleImg','ArticleController@articleImg');

    Route::get('/msg/index','MsgController@index');

    Route::get('/msg/{msg}','MsgController@show');

    Route::get('/article/{article}/answer','AnswerController@index');
});

